﻿package mortal.game.scene3D.player.entity
{
    import Message.BroadCast.*;
    import Message.DB.Tables.*;
    import Message.Public.*;
    import __AS3__.vec.*;
    import baseEngine.basic.*;
    import baseEngine.core.*;
    import baseEngine.modifiers.*;
    import baseEngine.system.*;
    import com.gengine.core.frame.*;
    import com.gengine.debug.*;
    import com.gengine.global.*;
    import com.gengine.keyBoard.*;
    import com.gengine.utils.*;
    import com.greensock.*;
    import com.mui.utils.*;
    import flash.events.*;
    import flash.text.*;
    import flash.utils.*;
    import frEngine.*;
    import frEngine.effectEditTool.temple.*;
    import frEngine.event.*;
    import frEngine.pools.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.rules.*;
    import mortal.game.scene3D.buff.*;
    import mortal.game.scene3D.display3d.blood.*;
    import mortal.game.scene3D.display3d.text3d.staticText3d.*;
    import mortal.game.scene3D.display3d.text3d.staticText3d.action.*;
    import mortal.game.scene3D.events.*;
    import mortal.game.scene3D.fight.*;
    import mortal.game.scene3D.layer3D.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.scene3D.map3D.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.model.*;
    import mortal.game.scene3D.model.data.*;
    import mortal.game.scene3D.model.player.*;
    import mortal.game.scene3D.player.head.*;
    import mortal.game.scene3D.player.info.*;
    import mortal.game.utils.*;
    import mortal.game.view.chat.data.*;
    import mortal.game.view.systemSetting.*;
    import mortal.mvc.core.*;

    public class SpritePlayer extends Game2DPlayer implements IUser
    {
        protected var _isInitInfo:Boolean = false;
        private var _selected:Boolean;
        protected var _actionName:String = "stand";
        protected var _actionType:String = "stand";
        protected var _speed:Speed;
        protected var _entityInfo:EntityInfo;
        protected var sentityInfo:SEntityInfo;
        protected var _inMount:Boolean = false;
        public var camp:int;
        public var career:int;
        public var sex:int;
        public var pointChangeHandler:Function;
        public var realPointChangeHandler:Function;
        protected var _bodyPlayer:ActionPlayer;
        protected var _targetDirection:Number;
        protected var _entityID:String = "";
        protected var _playerList:Vector.<Mesh3D>;
        protected var _headContainner:HeadContainer;
        protected var _timer:FrameTimer;
        protected var _isHasDeathCompl:Boolean = false;
        protected var _defaultScale:Number = 1;
        private var _tweenLite:TweenLite;
        protected var _timeKey:int;
        private var __timerContorler:TimeControler;
        private var _realX2d:int;
        private var _realY2d:int;
        private var _insertTime:int;
        private var _insertAngle:Number;
        protected var _direction:Number = 0;
        private var _isFrameUpdateNamePosition:Boolean = false;
        private var vcFightUpdateAttribtue:Vector.<FightUpdateAttribtue>;
        private var _isAlpha:Boolean = false;
        private var _isXray:Boolean = false;
        protected var _isDead:Boolean = false;
        private var _talkClearDate:Date;
        private var _talkText:TalkSprite;
        protected var _guildWarEffect:EffectPlayer;
        protected var _guildWarKey:String;
        protected var _tweenModelSize:TweenLite;
        private var _oldBuffUrlAry:Array;
        private var _stateMap:Dictionary;
        protected var _isInLeading:Boolean = false;
        protected var _tweenClearT:int;
        private static const actionVoParams:ActionVo = new ActionVo();

        public function SpritePlayer()
        {
            this._playerList = new Vector.<Mesh3D>;
            this.vcFightUpdateAttribtue = new Vector.<FightUpdateAttribtue>;
            this._oldBuffUrlAry = [];
            this._stateMap = new Dictionary();
            this._speed = new Speed();
            var _loc_1:* = Global3D;
            _loc_1.timeKeyId = Global3D.timeKeyId + 1;
            this._timeKey = Global3D.timeKeyId + 1;
            var _loc_1:* = TimeControler.createTimerInstance(null, null, this._timeKey);
            this.__timerContorler = TimeControler.createTimerInstance(null, null, this._timeKey);
            this.timerContorler = _loc_1;
            this.initHeadContainer();
            this.initPlayers();
            this._timer = new FrameTimer(3);
            this._timer.addListener(TimerType.ENTERFRAME, this.onFightEnterFrame);
            this.modelScale = 1;
            return;
        }// end function

        public function get realY2d() : int
        {
            return this._realY2d;
        }// end function

        public function get realX2d() : int
        {
            return this._realX2d;
        }// end function

        public function get entityID() : String
        {
            return this._entityID;
        }// end function

        protected function updateID() : void
        {
            this._entityID = EntityUtil.toString(this._entityInfo.entityInfo.entityId);
            return;
        }// end function

        public function get type() : int
        {
            return 0;
        }// end function

        override public function set y(param1:Number) : void
        {
            super.y = param1;
            return;
        }// end function

        override public function hoverTest(param1:Number, param2:Number, param3:Number, param4:Number) : Boolean
        {
            if (this.entityInfo && this.entityInfo.entityInfo.life <= 0)
            {
                return false;
            }
            var _loc_5:* = hoverLeft;
            var _loc_6:* = hoverTop;
            var _loc_7:* = hoverWidth;
            var _loc_8:* = hoverHeight;
            if (this._bodyPlayer)
            {
                _loc_7 = _loc_7 * this._bodyPlayer.scaleX;
                _loc_8 = _loc_8 * this._bodyPlayer.scaleY;
                _loc_5 = _loc_5 * this._bodyPlayer.scaleX;
                _loc_6 = _loc_6 * this._bodyPlayer.scaleY;
            }
            _displayRec.x = this.x2d - param1 - _loc_5;
            _displayRec.y = this.y2d - param2 - _loc_6;
            _displayRec.width = _loc_7;
            _displayRec.height = _loc_8;
            return _displayRec.contains(param3, param4);
        }// end function

        public function set selected(param1:Boolean) : void
        {
            if (this._selected == param1)
            {
                return;
            }
            var _loc_2:* = SceneGlobalPlayer.selectPlayerMask;
            this._selected = param1;
            if (param1)
            {
                if (this.contains(_loc_2) == false)
                {
                    this.addChild(_loc_2);
                    _loc_2.play(PlayMode.ANIMATION_LOOP_MODE);
                }
            }
            else if (this.contains(_loc_2))
            {
                _loc_2.stop();
                this.removeChild(_loc_2);
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.Player_Selected, this));
            ThingUtil.isEntitySort = true;
            ThingUtil.isHeadContainerChange = true;
            return;
        }// end function

        public function get selected() : Boolean
        {
            return this._selected;
        }// end function

        public function addToStage(param1:SLayer3D) : Boolean
        {
            if (!param1.contains(this))
            {
                param1.addChild(this);
                this.entityInfo.isInLayer = true;
                this.updateHeadContainer();
                return true;
            }
            return false;
        }// end function

        public function removeFromStage(param1:SLayer3D, param2:Boolean = false) : Boolean
        {
            if (param2)
            {
                this.entityInfo.isInLayer = false;
            }
            else
            {
                this.entityInfo.isInLayer = SystemSetting.instance.hideSetter.value == 2;
            }
            this.updateHeadContainer();
            if (ThingUtil.overEntity == this)
            {
                this.onMouseOut();
                ThingUtil.overEntity = null;
            }
            if (this.parent == param1)
            {
                param1.removeChild(this);
                return true;
            }
            return false;
        }// end function

        override public function onMouseOut() : void
        {
            var _loc_1:int = 0;
            _loc_1 = 0;
            while (_loc_1 < this._playerList.length)
            {
                
                Global3D.scene.removeSelectObject(this._playerList[_loc_1], false);
                _loc_1++;
            }
            return;
        }// end function

        override public function onMouseOver() : void
        {
            var _loc_2:uint = 0;
            var _loc_3:int = 0;
            var _loc_1:* = this._entityInfo && !EntityRelationUtil.isFriend(this._entityInfo.entityInfo);
            if (_loc_1)
            {
                _loc_2 = 15335424;
            }
            else
            {
                _loc_2 = 14596231;
            }
            _loc_3 = 0;
            while (_loc_3 < this._playerList.length)
            {
                
                Global3D.scene.addSelectObject(this._playerList[_loc_3], false, _loc_2);
                _loc_3++;
            }
            return;
        }// end function

        public function attack(param1:String) : void
        {
            var _loc_2:int = 0;
            var _loc_3:* = ModelAttackFrameConfig.instance.getAttackFrameInfo(this.career, this.sex, this._actionName);
            var _loc_4:* = ModelAttackFrameConfig.instance.getAttackFrameInfo(this.career, this.sex, param1);
            if (_loc_3 && GameDefConfig.instance.isAttackBatter(this._actionName, param1))
            {
                if (_loc_4 && this._bodyPlayer.currentFrame > _loc_3.handsEndFrame && this._bodyPlayer.currentFrame <= _loc_3.waitEndFrame)
                {
                    _loc_2 = _loc_4.handsEndFrame + 1;
                }
            }
            var _loc_5:* = this._bodyPlayer.getAttackFrame(param1);
            if (_loc_5 != 0)
            {
                this._bodyPlayer.addFrameScript(param1, _loc_5, this.onFightHandler);
            }
            else
            {
                this.onFightHandler();
            }
            this.setAction(ActionType.attack, param1);
            this._bodyPlayer.gotoFrame(_loc_2);
            return;
        }// end function

        private function onFightHandler() : void
        {
            FrEventDispatcher.instance.proxyDispatchEvent(this, PlayerEvent.PLAYER_FIRE, [this]);
            return;
        }// end function

        public function get actionName() : String
        {
            return this._actionName;
        }// end function

        public function get actionType() : String
        {
            return this._actionType;
        }// end function

        public function setAction(param1:String, param2:String, param3:Boolean = false) : void
        {
            if (this._actionName == param2)
            {
                return;
            }
            if (param1 == ActionType.Death)
            {
                if (this._actionType != ActionType.Death)
                {
                    this.refreshActionType(ActionType.Death);
                }
                this.refreshActionName(param2);
            }
            else if (!this.isDead)
            {
                if (param1 == ActionType.Injury)
                {
                    if (!this._inMount && this._actionType == ActionType.Stand)
                    {
                        this.refreshActionType(ActionType.Injury);
                        this.refreshActionName(ActionName.Injury);
                    }
                }
                else if (param1 == ActionType.leading)
                {
                    if (ActionType.isLeadStartAction(this._actionName) || param2 == ActionName.Tornado || param2 == ActionName.Collect || param2 == ActionName.SwimStand || GameMapUtil.curMapState.isGuildWar && param2 == this.getCareerGuildLeadinAction())
                    {
                        this.refreshActionType(ActionType.leading);
                        this.refreshActionName(param2);
                    }
                }
                else if (param1 == ActionType.Stand)
                {
                    if (this._actionName != ActionName.Tornado || param3)
                    {
                        this.refreshActionType(ActionType.Stand);
                        this.updateActionName();
                    }
                }
                else if (param1 == ActionType.Walking)
                {
                    if (this._actionName != ActionName.Tornado || param3)
                    {
                        this.refreshActionType(ActionType.Walking);
                        this.updateActionName();
                    }
                }
                else
                {
                    this.refreshActionType(param1);
                    this.refreshActionName(param2);
                }
            }
            return;
        }// end function

        protected function refreshActionName(param1:String) : void
        {
            var _loc_4:int = 0;
            if (this._actionName == param1)
            {
                return;
            }
            if (ActionType.isDeathAction(param1) && !this._isHasDeathCompl)
            {
                this.addDeathCompl();
            }
            var _loc_2:* = this._actionName;
            var _loc_3:* = this._bodyPlayer.currentFrame;
            this._actionName = param1;
            this._bodyPlayer.changeAction(this._actionName);
            if (this._actionName == ActionName.Death)
            {
                this._bodyPlayer.play(PlayMode.ANIMATION_STOP_MODE);
            }
            else
            {
                this._bodyPlayer.play();
            }
            if (ActionType.isLeadingAction(this._actionName))
            {
                FrEventDispatcher.instance.proxyDispatchEvent(this, PlayerEvent.PLAYER_LEADING, [this]);
            }
            if (ActionType.isLeadingAction(_loc_2))
            {
            }
            if (ActionType.isAttackAction(_loc_2))
            {
                _loc_4 = this._bodyPlayer.getAttackFrame(_loc_2);
                if (_loc_4 > 200)
                {
                    _loc_4 = this._bodyPlayer.getAttackFrame(_loc_2);
                }
                if (_loc_4 != 0 && _loc_3 <= _loc_4)
                {
                    this.onFightHandler();
                }
            }
            this._isFrameUpdateNamePosition = param1 == ActionName.Jump;
            if (this.actionName == ActionName.Swim || this.actionName == ActionName.SwimStand)
            {
                this._bodyPlayer.openUnlevelAlpha(0.2);
            }
            else
            {
                this._bodyPlayer.openUnlevelAlpha(1);
            }
            this.updateNamePosition();
            this.refreshActionNameCompl();
            return;
        }// end function

        protected function refreshActionNameCompl() : void
        {
            FrEventDispatcher.instance.proxyDispatchEvent(this, PlayerEvent.PLAYER_ACTION_CHANGE, [this]);
            return;
        }// end function

        protected function updateNamePosition() : void
        {
            this._headContainner.y = this._bodyPlayer.getBoneGlobleY(this._headContainner.hangBoneName);
            return;
        }// end function

        protected function refreshActionType(param1:String) : void
        {
            if (this._actionType == param1)
            {
                return;
            }
            this._actionType = param1;
            return;
        }// end function

        protected function updateActionName() : void
        {
            if (this._actionType == ActionType.Walking)
            {
                this.refreshActionName(ActionName.Walking);
            }
            if (this._actionType == ActionType.Stand)
            {
                this.refreshActionName(ActionName.Stand);
            }
            return;
        }// end function

        override public function update(param1:int = 0) : void
        {
            if (this._insertTime > 0)
            {
                if (this._insertTime > 1)
                {
                    this.updateDirection(this._direction + this._insertAngle);
                    var _loc_2:String = this;
                    var _loc_3:* = this._insertTime - 1;
                    _loc_2._insertTime = _loc_3;
                }
                else
                {
                    this.updateDirection(this._targetDirection);
                    this._insertTime = 0;
                }
            }
            if (this._isFrameUpdateNamePosition)
            {
                this.updateNamePosition();
            }
            super.update(param1);
            return;
        }// end function

        public function updateDirection(param1:Number) : void
        {
            if (param1 > 180)
            {
                param1 = param1 - 360;
            }
            else if (param1 < -180)
            {
                param1 = param1 + 360;
            }
            this._direction = param1;
            this.updateBodyDirection();
            return;
        }// end function

        protected function updateBodyDirection() : void
        {
            if (this._bodyPlayer)
            {
                this._bodyPlayer.direction = this._direction;
            }
            return;
        }// end function

        override public function set direction(param1:Number) : void
        {
            var _loc_2:Number = NaN;
            this._targetDirection = param1;
            _loc_2 = this._targetDirection - this._direction;
            if (_loc_2 > 180)
            {
                _loc_2 = _loc_2 - 360;
            }
            else if (_loc_2 < -180)
            {
                _loc_2 = _loc_2 + 360;
            }
            this._insertTime = Math.abs(Math.floor(_loc_2 / 12));
            this._insertTime = this._insertTime < 6 ? (6) : (this._insertTime);
            this._insertTime = this._insertTime > 12 ? (12) : (this._insertTime);
            this._insertAngle = _loc_2 / this._insertTime;
            if (this._insertTime == 0)
            {
                this.updateDirection(this._targetDirection);
            }
            return;
        }// end function

        override public function get direction() : Number
        {
            return this._direction;
        }// end function

        public function hurt(param1:int) : void
        {
            if (this._isDead || this.life <= 0)
            {
                this.delayLifeDeath();
            }
            if (param1 == 0)
            {
                return;
            }
            return;
        }// end function

        protected function delayLifeDeath() : void
        {
            return;
        }// end function

        public function cutHurtImpl(param1:FightUpdateAttribtue) : void
        {
            this.addToTweenCache(param1);
            return;
        }// end function

        private function addToTweenCache(param1:FightUpdateAttribtue) : void
        {
            if (this._timer.running)
            {
                if (this.vcFightUpdateAttribtue.length <= 20)
                {
                    this.vcFightUpdateAttribtue.push(param1);
                }
            }
            else
            {
                this.tween(param1, param1.isScale);
                this._timer.start();
            }
            return;
        }// end function

        private function onFightEnterFrame(param1:FrameTimer) : void
        {
            this.tweenNext();
            return;
        }// end function

        private function tween(param1:FightUpdateAttribtue, param2:Boolean) : void
        {
            actionVoParams.reInit(param1.textDirection, param1.fromX, param1.fromY - 80, param1.toX, param1.toY - 80, param2, true, param1.randomValue);
            var _loc_3:Pivot3D = this;
            if (param1.textDirection == 0)
            {
                _loc_3 = this.parent;
            }
            var _loc_4:* = SText3DFactory.instance.createtext3D(param1.getText(), param1.getColor(), _loc_3, actionVoParams, param1.isPetType);
            if (_loc_4)
            {
                if (param1.textDirection == 0)
                {
                    _loc_4.x = param1.toX3D;
                    _loc_4.y = param1.toY3D + 50;
                    _loc_4.z = param1.toZ3D;
                }
                else
                {
                    _loc_4.y = 100;
                }
            }
            return;
        }// end function

        private function tweenNext() : void
        {
            var _loc_1:FightUpdateAttribtue = null;
            if (this.vcFightUpdateAttribtue.length > 0)
            {
                _loc_1 = this.vcFightUpdateAttribtue.shift();
                this.tween(_loc_1, _loc_1.isCrit);
            }
            else
            {
                this._timer.stop();
            }
            return;
        }// end function

        public function updateInfo(param1:Object, param2:Boolean = true) : void
        {
            this._entityInfo = param1 as EntityInfo;
            this.sentityInfo = this._entityInfo.entityInfo;
            this.initHeadContainer();
            this.initPlayers();
            this.setAction(ActionType.Stand, ActionName.Stand);
            this.isDead = this.sentityInfo.life <= 0;
            if (this.sentityInfo == null)
            {
                return;
            }
            this._isInitInfo = true;
            this.updateID();
            var _loc_3:* = this.sentityInfo.points[(this.sentityInfo.points.length - 1)] as SPoint;
            this.setPixlePoint(_loc_3.x, _loc_3.y);
            this.updateOther(this.sentityInfo);
            this.updateCCS(this.sentityInfo, false);
            this.updateBuffers(this.sentityInfo.buffInfos);
            this.updateLife(this.sentityInfo.life, this.sentityInfo.maxLife, true);
            this.updateLevel(this.sentityInfo.level, false);
            this.updateMana(this.sentityInfo.mana, this.sentityInfo.maxMana);
            this.updateRoleActionName();
            this.updateSpeed(this.sentityInfo.speed);
            this.updateFighting(false);
            this.updateModel();
            this.updateStatus(this.sentityInfo.status);
            this.updateName(this.sentityInfo.name);
            this.updateGuildName();
            this.updateTitle();
            this.updateBossBelong();
            this.updateProxyVIP();
            this.updateWines();
            this.updateDisappear();
            this.updateHeadContainer();
            this.checkDistance();
            this.updateVisible();
            this.initModelSize();
            this.updateNamePosition();
            this._entityInfo.resetUpdateState();
            this.updateTreasure();
            this.updateBuffLeftTime();
            this.updateMainCityFlag();
            if (this.entityInfo.isInFly)
            {
                this.updateFly(this.entityInfo.isInFly, true);
            }
            if (this.entityInfo.reserveJs.pal)
            {
                this.updateWineLife(this.entityInfo.reserveJs.pal);
            }
            this.updateDirection(this.sentityInfo.direction);
            FrEventDispatcher.instance.proxyDispatchEvent(this, PlayerEvent.UPDATEINFO, [this]);
            return;
        }// end function

        public function updateDisplay() : void
        {
            if (this._isInitInfo && (this._entityInfo.buffEndTime && FrameManager.isSecUpdate || this._entityInfo.isUpdateBuffEndTime))
            {
                this.updateBuffLeftTime();
            }
            if (this._isInitInfo && this._entityInfo.isUpdate)
            {
                if (this._entityInfo.isUpdateInfo)
                {
                    this.sentityInfo = this._entityInfo.entityInfo;
                }
                if (this._entityInfo.isUpdateName)
                {
                    this.updateName(this.sentityInfo.name);
                }
                if (this._entityInfo.isUpdateProxyLv)
                {
                    this.updateProxyVIP();
                }
                if (this._entityInfo.isUpdateGuildName)
                {
                    this.updateGuildName();
                }
                if (this._entityInfo.isUpdateTitle)
                {
                    this.updateTitle();
                }
                if (this._entityInfo.isUpdateLevel)
                {
                    this.updateLevel(this._entityInfo.entityInfo.level, true);
                }
                if (this._entityInfo.isUpdateLife)
                {
                    this.updateLife(this.sentityInfo.life, this.sentityInfo.maxLife);
                }
                if (this._entityInfo.isUpdateMana)
                {
                    this.updateMana(this.sentityInfo.mana, this.sentityInfo.maxMana);
                }
                if (this._entityInfo.isUpdateSpeed)
                {
                    this.updateSpeed(this.sentityInfo.speed);
                }
                if (this._entityInfo.isUpdateFighting)
                {
                    this.updateFighting(false);
                }
                if (this._entityInfo.isUpdateBuffer)
                {
                    this.updateBuffers(this.sentityInfo.buffInfos);
                }
                if (this._entityInfo.isUpdateModel)
                {
                    this.updateModel();
                }
                if (this._entityInfo.isUpdateMount)
                {
                    this.updateMount(this.sentityInfo.mountCode);
                }
                if (this._entityInfo.isUpdateDirection)
                {
                    this.direction = this._entityInfo.entityInfo.direction;
                }
                if (this._entityInfo.isUpdateDisappear)
                {
                    this.updateDisappear();
                }
                if (this._entityInfo.isUpdateClothes)
                {
                    this.updateClothes(this._entityInfo.clothes);
                }
                if (this._entityInfo.isUpdateHair)
                {
                    this.updateHair(this._entityInfo.hair);
                }
                if (this._entityInfo.isUpdateWeapon)
                {
                    this.updateWeapons(this._entityInfo.weapon);
                }
                if (this._entityInfo.isUpdateWizard)
                {
                    this.updateWizard(this._entityInfo.entityInfo.spriteCode);
                }
                if (this._entityInfo.isUpdateWing)
                {
                    this.updateWing(this._entityInfo.wing);
                }
                if (this._entityInfo.isUpdateCCS)
                {
                    this.updateCCS(this._entityInfo.entityInfo);
                }
                if (this._entityInfo.isUpdateZazen)
                {
                    this.updateZazen(this._entityInfo.isSingleZazen);
                }
                if (this._entityInfo.isUpdateDoubleZazen)
                {
                    this.updateDoubleZazen(this._entityInfo.isDoubleZazen);
                }
                if (this._entityInfo.isUpdateCollect)
                {
                    this.updateCollect(this._entityInfo.isInCollect);
                }
                if (this._entityInfo.isUpdateSpeicalStatus)
                {
                    this.updateSpecialStatus();
                }
                if (this._entityInfo.isUpdateModelSize)
                {
                    this.updateModelSize();
                }
                if (this._entityInfo.isUpdateBossBelong)
                {
                    this.updateBossBelong();
                }
                if (this._entityInfo.isUpdateSun)
                {
                    this.updateSun(this._entityInfo.isInSun);
                }
                if (this._entityInfo.isUpdatePlayMusical)
                {
                    this.updatePlayMusical(this._entityInfo.isInPlayMusical);
                }
                if (this._entityInfo.isUpdateDance)
                {
                    this.updateDance(this._entityInfo.isInDance);
                }
                if (this._entityInfo.isUpdateToast)
                {
                    this.updateToast(this._entityInfo.isInToast);
                }
                if (this._entityInfo.isUpdateDrunk)
                {
                    this.updateDrunk(this._entityInfo.isInDrunk);
                }
                if (this._entityInfo.isUpdateWineIndexs)
                {
                    this.updateWines();
                }
                if (this._entityInfo.isUpdateTreasureBox)
                {
                    this.updateTreasure();
                }
                if (this._entityInfo.isUpdateFly)
                {
                    this.updateFly(this._entityInfo.isInFly, false);
                }
                if (this._entityInfo.isUpdateWineLife)
                {
                    this.updateWineLife(this.entityInfo.reserveJs.pal);
                }
                if (this._entityInfo.isUpdateMoraReady)
                {
                    this.updateMoraReady(this._entityInfo.isInMoraReady);
                }
                if (this._entityInfo.isUpdateMoraBeauty)
                {
                    this.updateMoraBeauty(this._entityInfo.isInMoraBeauty);
                }
                if (this._entityInfo.isUpdateMoraThief)
                {
                    this.updateMoraThief(this._entityInfo.isInMoraThief);
                }
                if (this._entityInfo.isUpdateMoraPolice)
                {
                    this.updateMoraPolice(this._entityInfo.isInMoraPolice);
                }
                if (this._entityInfo.isUpdateVIP)
                {
                    this.updateVIP();
                }
                if (this._entityInfo.isUpdateMainCityFlag)
                {
                    this.updateMainCityFlag();
                }
                this._entityInfo.resetUpdateState();
            }
            return;
        }// end function

        protected function initPlayers() : void
        {
            if (!this._bodyPlayer)
            {
                this._bodyPlayer = FrObjectPool.getObject(ActionPlayer, this);
                this._bodyPlayer.changeAction(ActionName.Stand);
                this._actionName = ActionName.Stand;
                this._actionType = ActionType.Stand;
                this._bodyPlayer.hangBoneName = BoneConst.MountHangModelBone;
                this._bodyPlayer.selectEnabled = true;
                this._bodyPlayer.timerContorler = this.timerContorler;
                this._bodyPlayer.play();
                FrEventDispatcher.instance.proxyAddEventListener(this._bodyPlayer, Engine3dEventName.InitComplete, this.onInitBodyPlayer);
                FrEventDispatcher.instance.proxyAddEventListener(this._bodyPlayer.targetMd5Controler, Engine3dEventName.TRACK_PARSERCOMPLETE, this.onPlayerActionComplete);
                this._playerList.push(this._bodyPlayer);
            }
            this.timerContorler.active(this._timeKey);
            this.addChild(this._bodyPlayer);
            return;
        }// end function

        protected function initHeadContainer() : void
        {
            if (!this._headContainner)
            {
                this._headContainner = FrObjectPool.getObject(HeadContainer, this);
                this._headContainner.y = 150;
                this.addChild(this._headContainner);
            }
            return;
        }// end function

        protected function onInitBodyPlayer(event:Event) : void
        {
            if (this._bodyPlayer)
            {
                if (this._isDead)
                {
                    this._actionType = ActionType.Death;
                    this.refreshActionName(ActionName.Death);
                    this._bodyPlayer.stop();
                    this._bodyPlayer.gotoFrame((this._bodyPlayer.getActionFrameLen(ActionName.Death) - 1), ActionName.Death);
                }
                this.addFrameComplete();
                this.updateNamePosition();
            }
            return;
        }// end function

        protected function onPlayerActionComplete(event:Event) : void
        {
            if (this._bodyPlayer)
            {
                this.updateNamePosition();
            }
            return;
        }// end function

        protected function addFrameComplete() : void
        {
            var _loc_1:int = 0;
            var _loc_3:String = null;
            var _loc_2:* = ActionName.attackActionList.length;
            _loc_1 = 0;
            while (_loc_1 < _loc_2)
            {
                
                this._bodyPlayer.addFrameComplete(ActionName.attackActionList[_loc_1], this.onOnesComplete);
                _loc_1++;
            }
            this._bodyPlayer.addFrameComplete(ActionName.Injury, this.onOnesComplete);
            this._bodyPlayer.addFrameComplete(ActionName.Jump, this.onOnesComplete);
            this._bodyPlayer.addFrameComplete(ActionName.StandStart, this.onOnesComplete);
            this._bodyPlayer.addFrameComplete(ActionName.Somersault, this.onOnesComplete);
            for (_loc_3 in ActionName.leadActionDic)
            {
                
                this._bodyPlayer.addFrameComplete(_loc_3, this.onLeadStartComplete);
            }
            this.addDeathCompl();
            return;
        }// end function

        protected function addDeathCompl() : void
        {
            this._bodyPlayer.addFrameComplete(ActionName.Death, this.onDeathComplete);
            if (this._bodyPlayer.hasAction(ActionName.DeathSpecial))
            {
                this._bodyPlayer.addFrameComplete(ActionName.DeathSpecial, this.onDeathComplete);
            }
            this._isHasDeathCompl = true;
            return;
        }// end function

        protected function removeDeathCompl() : void
        {
            this._bodyPlayer.removeFrameComplete(ActionName.Death, this.onDeathComplete);
            if (this._bodyPlayer.hasAction(ActionName.DeathSpecial))
            {
                this._bodyPlayer.removeFrameComplete(ActionName.DeathSpecial, this.onDeathComplete);
            }
            this._isHasDeathCompl = false;
            return;
        }// end function

        protected function onOnesComplete() : void
        {
            if (!this._bodyPlayer)
            {
                return;
            }
            if (this._actionType == ActionType.attack || this._actionType == ActionType.Injury || this._actionType == ActionType.Jump || this._actionType == ActionType.Speical)
            {
                this.setAction(ActionType.Stand, ActionName.Stand);
            }
            return;
        }// end function

        protected function onLeadStartComplete() : void
        {
            if (!this._bodyPlayer)
            {
                return;
            }
            if (ActionType.isLeadStartAction(this._bodyPlayer.actionName))
            {
                this.setAction(ActionType.leading, ActionName.leadActionDic[this._bodyPlayer.actionName]);
            }
            return;
        }// end function

        protected function onDeathComplete() : void
        {
            if (!this._bodyPlayer)
            {
                return;
            }
            if (ActionType.isDeathAction(this.actionName))
            {
                this.removeDeathCompl();
                this._bodyPlayer.stop();
                if (this._bodyPlayer.hasAction(this._actionName))
                {
                    this._bodyPlayer.gotoFrame((this._bodyPlayer.getActionFrameLen(this.actionName) - 1), this.actionName);
                }
                this.deathCompl();
            }
            return;
        }// end function

        protected function deathCompl() : void
        {
            return;
        }// end function

        protected function addFrameNextAction(param1:String, param2:String, param3:String) : void
        {
            var onFrameActionComplete:Function;
            var actionName1:* = param1;
            var actionType2:* = param2;
            var actionName2:* = param3;
            onFrameActionComplete = function () : void
            {
                setAction(actionType2, actionName2);
                _bodyPlayer.removeFrameComplete(actionName1, onFrameActionComplete);
                return;
            }// end function
            ;
            this._bodyPlayer.addFrameComplete(actionName1, onFrameActionComplete);
            return;
        }// end function

        protected function set scaleValue(param1:Number) : void
        {
            this._bodyPlayer.scaleX = param1;
            this._bodyPlayer.scaleY = param1;
            this._bodyPlayer.scaleZ = param1;
            return;
        }// end function

        public function get entityInfo() : EntityInfo
        {
            return this._entityInfo;
        }// end function

        protected function getPointValue(param1:int, param2:int) : int
        {
            return GameMapUtil.getPointValue(param1, param2);
        }// end function

        protected function updateXray(param1:int, param2:int) : void
        {
            this.isXray = GameMapUtil.isXLightGrid(param1, param2);
            return;
        }// end function

        protected function updateAlpha(param1:int) : void
        {
            this.isAlpha = MapNodeType.isAlpha(param1);
            return;
        }// end function

        public function get isXray() : Boolean
        {
            return this._isXray;
        }// end function

        public function set isXray(param1:Boolean) : void
        {
            this._isXray = param1;
            return;
        }// end function

        public function set isAlpha(param1:Boolean) : void
        {
            if (this._isAlpha != param1)
            {
                this._isAlpha = param1;
            }
            this.updateAlphaImpl();
            return;
        }// end function

        public function get isAlpha() : Boolean
        {
            return this._isAlpha;
        }// end function

        protected function updateAlphaImpl() : void
        {
            var _loc_1:Mesh3D = null;
            if (!this._entityInfo)
            {
                return;
            }
            var _loc_2:Number = 1;
            var _loc_3:Boolean = false;
            if (this._entityInfo.isDisappear)
            {
                _loc_2 = 0.2;
                _loc_3 = false;
            }
            else if (this._isAlpha)
            {
                _loc_2 = 1;
                _loc_3 = true;
            }
            else
            {
                _loc_2 = 1;
                _loc_3 = false;
            }
            for each (_loc_1 in this._playerList)
            {
                
                _loc_1.alpha = _loc_2;
                _loc_1.maskEnable = _loc_3;
                _loc_1.xrayEnable = this._isXray;
            }
            return;
        }// end function

        public function get isInitInfo() : Boolean
        {
            return this._isInitInfo;
        }// end function

        protected function move() : void
        {
            this.setAction(ActionType.Walking, ActionName.Walking);
            return;
        }// end function

        protected function updateOther(param1:SEntityInfo, param2:Boolean = true) : void
        {
            return;
        }// end function

        public function setPixlePoint(param1:int, param2:int, param3:Boolean = true, param4:Boolean = true) : void
        {
            this.x2d = param1;
            this.y2d = param2;
            this.setRealPoint(param1, param2);
            if (this.pointChangeHandler is Function)
            {
                this.pointChangeHandler();
            }
            return;
        }// end function

        public function setRealPoint(param1:int, param2:int) : void
        {
            this._realX2d = param1;
            this._realY2d = param2;
            if (this.realPointChangeHandler is Function)
            {
                this.realPointChangeHandler();
            }
            return;
        }// end function

        public function get isDead() : Boolean
        {
            return this._isDead;
        }// end function

        public function set isDead(param1:Boolean) : void
        {
            if (this._isDead != param1)
            {
                this._isDead = param1;
                this.isDeadChange();
            }
            return;
        }// end function

        protected function isDeadChange() : void
        {
            return;
        }// end function

        public function walking(param1:Array) : void
        {
            this.move();
            return;
        }// end function

        public function diversion(param1:Array) : void
        {
            this.move();
            return;
        }// end function

        public function talk(param1:String, param2:Number = 5000) : void
        {
            if (param1 != null && param1 != "")
            {
                if (this._talkText == null)
                {
                    this._talkText = UICompomentPool.getUICompoment(TalkSprite);
                }
                if (this._talkClearDate)
                {
                    ClockManager.instance.removeDateCall(this._talkClearDate);
                }
                this._talkClearDate = ClockManager.instance.getDelayDate(param2);
                ClockManager.instance.addDateCall(this._talkClearDate, this.timeoutClearTalk);
                LayerManager.entityTalkLayer.addPopUp(this._talkText);
                this._talkText.faceAuthortiy = this.faceAuthority;
                this._talkText.text = param1;
                this.updateTalkXY();
            }
            else
            {
                this.clearTalk();
            }
            return;
        }// end function

        protected function timeoutClearTalk() : void
        {
            LayerManager.entityTalkLayer.removeTalk(this);
            return;
        }// end function

        public function clearTalk() : void
        {
            if (this._talkText)
            {
                LayerManager.entityTalkLayer.removePopup(this._talkText);
                this._talkText.dispose();
                this._talkText = null;
                if (this._talkClearDate)
                {
                    ClockManager.instance.removeDateCall(this._talkClearDate);
                    this._talkClearDate = null;
                }
            }
            return;
        }// end function

        public function updateTalkXY() : void
        {
            var _loc_1:int = 0;
            var _loc_2:int = 0;
            if (this._talkText)
            {
                _loc_1 = this.x2d - SceneRange.display.x;
                _loc_2 = this.y2d - SceneRange.display.y - 180;
                this._talkText.x = _loc_1;
                this._talkText.y = _loc_2;
            }
            return;
        }// end function

        protected function checkDistance() : void
        {
            return;
        }// end function

        public function get toRoleDistance() : Number
        {
            var _loc_1:* = this.x2d - RolePlayer.instance.x2d;
            var _loc_2:* = this.y2d - RolePlayer.instance.y2d;
            return _loc_1 * _loc_1 + _loc_2 * _loc_2;
        }// end function

        public function updateWeapons(param1:int) : void
        {
            return;
        }// end function

        public function updateWizard(param1:int) : void
        {
            return;
        }// end function

        public function updateWing(param1:int) : void
        {
            return;
        }// end function

        public function updateClothes(param1:int) : void
        {
            return;
        }// end function

        public function updateHair(param1:int) : void
        {
            return;
        }// end function

        public function updateStatus(param1:int, param2:Boolean = true) : void
        {
            this.updateZazen(this._entityInfo.isSingleZazen);
            this.updateDoubleZazen(this._entityInfo.isDoubleZazen);
            this.updateSun(this._entityInfo.isInSun);
            this.updatePlayMusical(this._entityInfo.isInPlayMusical);
            this.updateDance(this._entityInfo.isInDance);
            return;
        }// end function

        public function updateZazen(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateSun(param1:Boolean) : void
        {
            return;
        }// end function

        public function updatePlayMusical(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateDance(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateToast(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateDrunk(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateMoraReady(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateMoraBeauty(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateMoraThief(param1:Boolean) : void
        {
            return;
        }// end function

        public function updateMoraPolice(param1:Boolean) : void
        {
            return;
        }// end function

        protected function updateVIP() : void
        {
            return;
        }// end function

        protected function updateMainCityFlag() : void
        {
            return;
        }// end function

        public function updateDoubleZazen(param1:Boolean) : void
        {
            return;
        }// end function

        private function getCareerGuildLeadinAction() : String
        {
            var _loc_1:* = ActionName.Collect;
            switch(this.entityInfo.entityInfo.career)
            {
                case ECareer._ECareerWarrior:
                {
                    _loc_1 = "fightwait";
                    break;
                }
                case ECareer._ECareerArcher:
                {
                    _loc_1 = "skill10-ing";
                    break;
                }
                case ECareer._ECareerMage:
                {
                    _loc_1 = "skill08-ing";
                    break;
                }
                case ECareer._ECareerPriest:
                {
                    _loc_1 = "skill08-ing";
                    break;
                }
                default:
                {
                    break;
                    break;
                }
            }
            return _loc_1;
        }// end function

        public function updateCollect(param1:Boolean) : void
        {
            var _loc_2:SpritePlayer = null;
            var _loc_3:Number = NaN;
            if (param1)
            {
                if (GameMapUtil.curMapState.isGuildWar)
                {
                    this.setAction(ActionType.leading, this.getCareerGuildLeadinAction());
                }
                else
                {
                    this.setAction(ActionType.leading, ActionName.Collect);
                }
                if (this._entityInfo.entityInfo.toEntityId)
                {
                    _loc_2 = ThingUtil.entityUtil.getEntity(this._entityInfo.entityInfo.toEntityId) as SpritePlayer;
                    if (_loc_2)
                    {
                        _loc_3 = MathUitl.getAngleByXY(this.x2d, this.y2d, _loc_2.x2d, _loc_2.y2d);
                        this.direction = _loc_3;
                        if (GameMapUtil.curMapState.isGuildWar)
                        {
                            this.disposeGuildWarEffect();
                            this._guildWarKey = FightChainUtil.addChain(this, _loc_2, "GH_caiji01");
                            this._guildWarEffect = SkillEffectUtil.addPlayerEffect(_loc_2, "GH_caiji02", false, false, null, PlayMode.ANIMATION_LOOP_MODE);
                        }
                    }
                }
            }
            else
            {
                if (this.actionType == ActionType.leading)
                {
                    this.setAction(ActionType.Stand, ActionName.Stand);
                }
                this.disposeGuildWarEffect();
            }
            return;
        }// end function

        protected function disposeGuildWarEffect() : void
        {
            if (this._guildWarEffect)
            {
                this._guildWarEffect.dispose();
                this._guildWarEffect = null;
            }
            if (this._guildWarKey)
            {
                FightChainUtil.removeChain(this._guildWarKey);
                this._guildWarKey = "";
            }
            return;
        }// end function

        protected function updateSpecialStatus() : void
        {
            return;
        }// end function

        protected function initModelSize() : void
        {
            if (this.entityInfo.modelScale)
            {
                this.modelScale = this.entityInfo.modelScale;
            }
            else
            {
                this.modelScale = this._defaultScale;
            }
            return;
        }// end function

        protected function updateModelSize() : void
        {
            if (this.entityInfo.modelScale)
            {
                this.removeTweenModel();
                this._tweenModelSize = TweenLite.to(this, 0.5, {modelScale:this.entityInfo.modelScale, onUpdate:function () : void
            {
                updateNamePosition();
                return;
            }// end function
            });
            }
            else
            {
                this.resetToDefaultModelSize();
            }
            return;
        }// end function

        protected function updateBigSize(param1:int) : void
        {
            if (param1 > 6)
            {
                return;
            }
            var _loc_2:Number = 0;
            if (param1 % 2)
            {
                this.alpha = 0.3;
                _loc_2 = 0.2;
            }
            else
            {
                this.alpha = 1;
            }
            var _loc_3:* = (param1 + 1) / 2;
            var _loc_4:* = this._defaultScale + _loc_2 + (this.entityInfo.modelScale - this._defaultScale) * _loc_3 / 3;
            this.modelScale = _loc_4;
            this.updateNamePosition();
            setTimeout(this.updateBigSize, 150, ++param1);
            return;
        }// end function

        protected function resetToDefaultModelSize() : void
        {
            this.removeTweenModel();
            this._tweenModelSize = TweenLite.to(this, 0.5, {modelScale:this._defaultScale, onUpdate:function () : void
            {
                updateNamePosition();
                return;
            }// end function
            });
            return;
        }// end function

        protected function removeTweenModel() : void
        {
            if (this._tweenModelSize)
            {
                this._tweenModelSize.kill();
                this._tweenModelSize = null;
            }
            return;
        }// end function

        public function get modelScale() : Number
        {
            return this.scaleX;
        }// end function

        public function set modelScale(param1:Number) : void
        {
            this.scaleX = param1;
            this.scaleY = param1;
            this.scaleZ = param1;
            return;
        }// end function

        protected function updateFighting(param1:Boolean = true) : void
        {
            if (this.entityInfo.fighting == false)
            {
                this.entityInfo.updateIsAttackRole(false);
            }
            this.updateActionName();
            return;
        }// end function

        protected function updateRoleActionName() : void
        {
            return;
        }// end function

        public function updateSpeed(param1:int) : void
        {
            this._speed.timeSpeed = param1;
            return;
        }// end function

        protected function updateGroupStatus(param1:int) : void
        {
            return;
        }// end function

        public function updateFightMode(param1:int) : void
        {
            return;
        }// end function

        public function updateLevel(param1:int, param2:Boolean) : void
        {
            if (!GameMapUtil.curMapState.isWineMap)
            {
                this._headContainner.updateLevel(param1);
            }
            return;
        }// end function

        public function updateCCS(param1:SEntityInfo, param2:Boolean = false) : void
        {
            this.camp = param1.camp;
            this.career = param1.career;
            this.sex = param1.sex;
            return;
        }// end function

        public function updateGrowthMax(param1:int) : void
        {
            return;
        }// end function

        public function updateVisible() : void
        {
            this.addToStage(Game.scene.playerLayer);
            return;
        }// end function

        public function updateModel() : void
        {
            return;
        }// end function

        protected function updateBuffers(param1:Array) : void
        {
            var _loc_3:TBuff = null;
            var _loc_4:SBuffInfo = null;
            var _loc_5:Array = null;
            var _loc_6:Array = null;
            var _loc_7:int = 0;
            var _loc_8:Boolean = false;
            var _loc_9:Boolean = false;
            var _loc_2:Array = [];
            for each (_loc_4 in param1)
            {
                
                _loc_3 = BuffConfig.instance.getInfoById(_loc_4.buffId);
                if (_loc_3 && _loc_3.specialEffectId && _loc_3.specialEffectId != "10000")
                {
                    if (!Global.isMinimize || _loc_3.lastTime == -1 || _loc_3.lastTime > 30000)
                    {
                        _loc_8 = _loc_3.type == EBuffType._EBuffTypeXpSkillEffect;
                        if (_loc_8)
                        {
                            _loc_9 = this.entityInfo && EntityRelationUtil.isOwnerSelf(this.entityInfo.entityInfo);
                            if (FightEffectChecker.check(_loc_9, true))
                            {
                                _loc_2.push(_loc_3.specialEffectId);
                            }
                            continue;
                        }
                        if (_loc_3.type == EBuffType._EBuffTypeChain && _loc_4.fromEntityIds.length)
                        {
                            continue;
                        }
                        if (_loc_2.indexOf(_loc_3.specialEffectId) == -1)
                        {
                            _loc_2.push(_loc_3.specialEffectId);
                        }
                    }
                }
            }
            _loc_5 = ArrayUtil.cut(_loc_2, this._oldBuffUrlAry);
            _loc_6 = ArrayUtil.cut(this._oldBuffUrlAry, _loc_2);
            _loc_7 = 0;
            while (_loc_7 < _loc_5.length)
            {
                
                this.addStateModel(_loc_5[_loc_7], true);
                _loc_7++;
            }
            _loc_7 = 0;
            while (_loc_7 < _loc_6.length)
            {
                
                this.removeStateModel(_loc_6[_loc_7]);
                _loc_7++;
            }
            this._oldBuffUrlAry = _loc_2;
            _loc_7 = 0;
            while (_loc_7 < this.entityInfo.addChainArray.length)
            {
                
                _loc_3 = BuffConfig.instance.getInfoById((this.entityInfo.addChainArray[_loc_7] as SBuffInfo).buffId);
                if (_loc_3 && _loc_3.specialEffectId && _loc_3.specialEffectId != "10000")
                {
                    if (!Global.isMinimize || _loc_3.lastTime == -1 || _loc_3.lastTime > 30000)
                    {
                        BuffChainUtil.addChain(_loc_3.specialEffectId, this, this.entityInfo.addChainArray[_loc_7]);
                    }
                }
                _loc_7++;
            }
            _loc_7 = 0;
            while (_loc_7 < this.entityInfo.removeChainArray.length)
            {
                
                BuffChainUtil.removeChain(this, this.entityInfo.removeChainArray[_loc_7]);
                _loc_7++;
            }
            return;
        }// end function

        public function updateMount(param1:int) : void
        {
            return;
        }// end function

        public function updateDisappear() : void
        {
            this.updateAlphaImpl();
            return;
        }// end function

        protected function clearStateModel() : void
        {
            var _loc_1:EffectPlayer = null;
            for each (_loc_1 in this._stateMap)
            {
                
                _loc_1.dispose();
            }
            this._stateMap = new Dictionary();
            this._oldBuffUrlAry = [];
            return;
        }// end function

        public function updateStateScale() : void
        {
            var _loc_1:EffectPlayer = null;
            for each (_loc_1 in this._stateMap)
            {
                
                if (this.bodyPlayer && !(_loc_1.temple is TempleRole))
                {
                    _loc_1.scaleX = this.bodyPlayer.scaleX;
                    _loc_1.scaleY = this.bodyPlayer.scaleY;
                    _loc_1.scaleZ = this.bodyPlayer.scaleZ;
                }
            }
            return;
        }// end function

        public function addStateModel(param1:String, param2:Boolean = false) : void
        {
            if (FightEffectUtil.isShieldEffect())
            {
                return;
            }
            var _loc_3:* = this._stateMap[param1] as EffectPlayer;
            if (!_loc_3)
            {
                _loc_3 = SkillEffectUtil.addPlayerEffect(this, param1, false, false, null, PlayMode.ANIMATION_LOOP_MODE);
                if (_loc_3 && this.bodyPlayer && !(_loc_3.temple is TempleRole))
                {
                    _loc_3.scaleX = this.bodyPlayer.scaleX;
                    _loc_3.scaleY = this.bodyPlayer.scaleY;
                    _loc_3.scaleZ = this.bodyPlayer.scaleZ;
                }
                if (_loc_3)
                {
                    _loc_3.clearEnabled = !param2;
                    this._stateMap[param1] = _loc_3;
                }
            }
            return;
        }// end function

        public function removeStateModel(param1:String) : void
        {
            var _loc_2:* = this._stateMap[param1] as EffectPlayer;
            if (_loc_2)
            {
                delete this._stateMap[param1];
                _loc_2.dispose();
            }
            return;
        }// end function

        public function updateHeadContainer() : void
        {
            if (!this.entityInfo)
            {
                return;
            }
            var _loc_1:* = this.entityInfo.isInLayer;
            var _loc_2:* = this.selected;
            var _loc_3:* = SystemSetting.instance.isHideLife.bValue && !KeyBoardManager.AltKey && !EntityRelationUtil.isSelfCarByEntityId(this.entityInfo.entityInfo) || this.entityInfo.isInHidden || this._entityInfo.entityInfo.entityId.type == EntityType.Boss && this._entityInfo.entityInfo.life <= 0 || this._entityInfo.isHide;
            var _loc_4:* = SystemSetting.instance.isHideOterPlayerName.bValue;
            var _loc_5:* = SystemSetting.instance.isHideTitle.bValue;
            var _loc_6:* = SystemSetting.instance.isHideGuildName.bValue;
            this._headContainner.updateBloodVisible(_loc_1 && !GameMapUtil.isInHideBloodMap && (!_loc_3 || _loc_2 || this.entityInfo.isAttackRole || GameMapUtil.isInShowBloodMap));
            this._headContainner.updateNameVisible(_loc_1 && !this.entityInfo.isInHidden && !this.entityInfo.isHide && (!_loc_3 || _loc_2 || this.entityInfo.isAttackRole));
            this._headContainner.updateGuildVisible(_loc_1 && !GameMapUtil.isInHideGuildMap && (!_loc_6 && !(_loc_4 && !_loc_2)));
            this._headContainner.updateTitleVisible(_loc_1 && !GameMapUtil.isInHideTitleMap && !_loc_5);
            return;
        }// end function

        public function updateBloodVisible() : void
        {
            var _loc_1:* = this.entityInfo.isInLayer;
            var _loc_2:* = this.selected;
            var _loc_3:* = SystemSetting.instance.isHideLife.bValue || this.entityInfo.isInHidden || this._entityInfo.entityInfo.entityId.type == EntityType.Boss && this._entityInfo.entityInfo.life <= 0 || this._entityInfo.isHide;
            this._headContainner.updateBloodVisible(_loc_1 && (!_loc_3 || _loc_2));
            return;
        }// end function

        public function updateLife(param1:int, param2:int, param3:Boolean = false) : void
        {
            this._headContainner.updateLife(param1, param2, this.getBloodType());
            return;
        }// end function

        public function updateWineLife(param1:int) : void
        {
            return;
        }// end function

        protected function getBloodType() : int
        {
            return EBloodType.Monster;
        }// end function

        public function updateMana(param1:int, param2:int) : void
        {
            return;
        }// end function

        public function addSkillName(param1:TextField) : void
        {
            this._headContainner.addSkillName(param1);
            return;
        }// end function

        public function updateName(param1:String = null, param2:Boolean = true) : void
        {
            this._headContainner.updateName(param1);
            return;
        }// end function

        public function updateProxyVIP() : void
        {
            return;
        }// end function

        protected function updateGuildName() : void
        {
            return;
        }// end function

        protected function updateTitle() : void
        {
            var _loc_1:* = this._entityInfo.entityInfo.titleId;
            var _loc_2:* = TitleConfig.instance.getInfoById(_loc_1);
            var _loc_3:Array = [];
            if (_loc_2 && _loc_2.proxyId)
            {
                _loc_3 = _loc_2.proxyId.split("#");
                if (_loc_3.indexOf(Cache.instance.role.entityInfo.entityId.typeEx2.toString()) == -1)
                {
                    _loc_1 = 0;
                }
            }
            this._headContainner.updateTitle(_loc_1);
            return;
        }// end function

        protected function updateBossBelong() : void
        {
            this._headContainner.updateBossBelong(this._entityInfo.isBossBelong);
            return;
        }// end function

        protected function updateWines() : void
        {
            return;
        }// end function

        protected function updateTreasure() : void
        {
            return;
        }// end function

        protected function updateFly(param1:Boolean, param2:Boolean) : void
        {
            return;
        }// end function

        protected function updateBuffLeftTime() : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:String = null;
            if (!this._entityInfo.buffEndTime)
            {
                this._headContainner.updateLeftTimeVisible(false);
                return;
            }
            var _loc_1:* = (this._entityInfo.buffEndTime - FrameManager.flashFrame.getTime()) / 1000;
            var _loc_2:* = HTMLUtil.addColor("0:00", GlobalStyle.colorHong);
            if (_loc_1 > 0)
            {
                _loc_3 = _loc_1 / 60;
                _loc_4 = _loc_1 - _loc_3 * 60;
                _loc_5 = (_loc_4 < 10 ? ("0") : ("")) + _loc_4;
                _loc_2 = HTMLUtil.addColor(_loc_3 + ":" + _loc_5, GlobalStyle.colorHong);
            }
            this._headContainner.updateLeftTime(_loc_2);
            this._headContainner.updateLeftTimeVisible(true);
            return;
        }// end function

        public function death(param1:Boolean = false) : void
        {
            return;
        }// end function

        public function get life() : int
        {
            if (this._entityInfo.entityInfo)
            {
                return this._entityInfo.entityInfo.life;
            }
            return 0;
        }// end function

        public function get faceAuthority() : int
        {
            if (this.entityInfo && this.entityInfo.entityInfo)
            {
                if (this._entityInfo.entityInfo.entityId.type == EEntityType._EEntityTypePlayer)
                {
                    if (VipConfig.instance.isShowEffect(EVipRecordType._EVipRecordTypeExpress, this.entityInfo.entityInfo.VIP))
                    {
                        return FaceAuthority.getFullAuthority();
                    }
                    return FaceAuthority.NORMAL;
                }
                else
                {
                    return FaceAuthority.getFullAuthority();
                }
            }
            return 0;
        }// end function

        public function playAction(param1:String, param2:Boolean, param3:int = 0, param4:Function = null) : void
        {
            var onComplete:Function;
            var onActionComplete:Function;
            var date:Date;
            var actionName:* = param1;
            var isRepeat:* = param2;
            var time:* = param3;
            var callBack:* = param4;
            onComplete = function () : void
            {
                onActionComplete();
                return;
            }// end function
            ;
            onActionComplete = function () : void
            {
                setAction(ActionType.Stand, ActionName.Stand);
                if (callBack != null)
                {
                    callBack.call();
                }
                return;
            }// end function
            ;
            if (this._bodyPlayer)
            {
                this._bodyPlayer.changeAction(actionName);
                if (!isRepeat)
                {
                    this._bodyPlayer.addFrameComplete(actionName, onActionComplete);
                }
            }
            if (time > 0)
            {
                date = ClockManager.instance.getDelayDate(time);
                ClockManager.instance.addDateCall(date, onComplete);
            }
            return;
        }// end function

        public function get isInLeading() : Boolean
        {
            return this._isInLeading;
        }// end function

        public function set isInLeading(param1:Boolean) : void
        {
            if (!param1 && this._isInLeading)
            {
                FrEventDispatcher.instance.proxyDispatchEvent(this, PlayerEvent.PLAYER_LEADING_END, [this]);
            }
            this._isInLeading = param1;
            return;
        }// end function

        override public function dispose(param1:Boolean = true) : void
        {
            var _loc_2:ActionPlayer = null;
            if (this._entityInfo == null)
            {
                Log.error("释放的时候对象EntityInfo为空" + this.toString());
            }
            this.disposeGuildWarEffect();
            BuffChainUtil.removePlayerAllChains(this);
            this._isInLeading = false;
            this.removeTweenLite();
            if (this.entityInfo)
            {
                ThingUtil.entityUtil.entitysMap.removeEntity(this.entityInfo.entityInfo.entityId);
                Cache.instance.entity.removeEntity(this.entityInfo.entityInfo.entityId);
                this.entityInfo.dispose();
            }
            this._isInitInfo = false;
            this.vcFightUpdateAttribtue.length = 0;
            this._defaultScale = 1;
            this.removeTweenModel();
            this.setAction(ActionType.Stand, ActionName.Stand);
            this.pointChangeHandler = null;
            this.realPointChangeHandler = null;
            this.modelScale = 1;
            this.timerContorler.unActive(this._timeKey);
            if (ThingUtil.selectEntity == this)
            {
                ThingUtil.selectEntity = null;
            }
            this.sentityInfo = null;
            this._entityInfo = null;
            this._isDead = false;
            if (this._bodyPlayer)
            {
                _loc_2 = this._bodyPlayer;
                this._bodyPlayer = null;
                FrEventDispatcher.instance.proxyRemoveEventListener(_loc_2.targetMd5Controler, Engine3dEventName.TRACK_PARSERCOMPLETE, this.onPlayerActionComplete);
                FrEventDispatcher.instance.proxyRemoveEventListener(_loc_2, Engine3dEventName.InitComplete, this.onInitBodyPlayer);
                _loc_2.dispose();
            }
            if (this._headContainner)
            {
                this._headContainner.clear();
                this._headContainner.dispose();
                this._headContainner = null;
            }
            this._isAlpha = false;
            this._speed.timeSpeed = 0;
            this._actionName = "stand";
            this._actionType = "stand";
            this._entityID = "";
            this._playerList = new Vector.<Mesh3D>;
            this._targetDirection = 0;
            this._insertTime = 0;
            this._insertAngle = 0;
            this._direction = 0;
            this.clearStateModel();
            this._inMount = false;
            LayerManager.entityTalkLayer.removeTalk(this);
            this._timer.stop();
            this._isFrameUpdateNamePosition = false;
            this._isHasDeathCompl = false;
            FrEventDispatcher.instance.proxyDispatchEvent(this, PlayerEvent.Disposed, [this]);
            this._realX2d = 0;
            this._realY2d = 0;
            super.dispose(param1);
            this.timerContorler = this.__timerContorler;
            return;
        }// end function

        public function get bodyPlayer() : ActionPlayer
        {
            return this._bodyPlayer;
        }// end function

        public function get headContainner() : HeadContainer
        {
            return this._headContainner;
        }// end function

        public function set tweenLite(param1:TweenLite) : void
        {
            this.removeTweenLite();
            this._tweenLite = param1;
            this._tweenClearT = setTimeout(this.removeTweenLite, 2000);
            return;
        }// end function

        public function get isJumping() : Boolean
        {
            return this._tweenLite != null;
        }// end function

        public function removeTweenLite() : void
        {
            if (this._tweenLite && this._tweenLite.active)
            {
                this._tweenLite.kill();
            }
            this._tweenLite = null;
            if (this._tweenClearT)
            {
                clearTimeout(this._tweenClearT);
                this._tweenClearT = 0;
            }
            return;
        }// end function

        protected function getRenderList() : RenderList
        {
            if (this._entityInfo && this._entityInfo.isInFly)
            {
                return LastRender.instance.renderList;
            }
            return Global3D.scene.renderLayerList;
        }// end function

    }
}
